﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

using NUnitResults;

namespace NUnitResultsExplorer
{
    [ValueConversion(typeof(SuiteType), typeof(String))]
    public class SuiteTypeToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var s = (SuiteType)value;

            var suiteTypes = new Dictionary<SuiteType, String>
            {
                { SuiteType.Assembly, "Assembly" },
                { SuiteType.TestProject, "Test Project" },
                { SuiteType.Namespace, "Namespace" },
                { SuiteType.TestFixture, "Test Fixture" },
                { SuiteType.ParameterizedTest, "Parameterized Test" },
                { SuiteType.Theory, "Theory" },
                { SuiteType.TestCase, "Test Case" },
                { SuiteType.Unrecognised, "Unrecognised" }
            };

            return suiteTypes[s];
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
